//var icon = "https://google-maps-icons.googlecode.com/files/home.png";

function Houses(config) {

	this.houseName = config.name;
	this.position = config.position;

	this.getName = function() {
		return this.houseName;
	}

	this.getLoc = function() {
		console.log("this.getLoc= function(){ " + this.position.lat());
		//return this.position;
	}
	this.setLoc = function(value) {
		this.position = value;
		//return this.position;
	}
}

Houses.prototype.getHomeLocationFromDB = function(HomeIcon, home) {
	var tempData = null;

	$.getJSON("php/getHomeLatLng.php", {
		format : "json"
	}, function(data) {
		if ( typeof data.lat != 'undefined') {
			isHomeFound = true;

			var latlng = data.name + " : " + data.lat + ", " + data.lng;
			$("#homelatlng").text(latlng);
			$("#pickHome").hide();

			//returns data to
			tempData = data;

		} else {
			isHomeFound = false;
			$("#pickHome").show();
		}
	}).done(function() {
		if (tempData != null) {
			homePos = new google.maps.LatLng(tempData.lat, tempData.lng);
			home.setLoc(new google.maps.LatLng(tempData.lat, tempData.lng));
		}

	});
}

